//
// Created by shen on 8/8/2024.
//

#ifndef TSAVPLAYER_NATIVEWINDOWRENDER_H
#define TSAVPLAYER_NATIVEWINDOWRENDER_H

#include <android/native_window.h>
#include <android/native_window_jni.h>
#include <jni.h>
#include "VideoRender.h"

class NativeWindowRender: public VideoRender {
public:
    NativeWindowRender(JNIEnv *env, jobject surface);
    virtual ~NativeWindowRender();
    virtual void Init(int videoWidth, int videoHeight, int *dstSize);
    virtual void RenderVideoFrame(NativeImage *pImage);
    virtual void UnInit();
private:
    ANativeWindow_Buffer m_NativeWindowBuffer;
    ANativeWindow *m_NativeWindow= nullptr;
    int m_DstWidth;
    int m_DstHeight;
};


#endif //TSAVPLAYER_NATIVEWINDOWRENDER_H
